Function: serializeDOM

CALL:

String = serialize(DOM) serialize(DOM,fileName)

DESCRIPTION:

Serialise a DOM by transformation to a string or file

INPUT:

      DOM:      <java-object> org.apache.xerces.dom.DocumentImpl
      fileName: <string> (optional) valid filename
 

OUTPUT:

      String: <string>  if nargin == 1 the serialised DOM
              <boolean> if nargin == 2, 
                                     0 -> saving to fileName not successful
                                     1 -> saving to fileName successful
 

EXAMPLE:

      obj = xml %create an empty xml object
      obj.date = now %add fields with values
      obj.type = 'test'
      save(obj,'test.xml')
      obj('test.xml')
      inspect(obj)